package com.nerve.secondhandcar.dao.car;

import java.util.List;

import org.ko.core.dao.hibernate4.BaseTypedDao;
import org.ko.core.dao.support.Finder;
import org.springframework.stereotype.Repository;

import com.nerve.secondhandcar.domain.car.CarCategory;

@Repository
public class CarCategoryDao extends BaseTypedDao<CarCategory, Long>{

	/**
	 * 
	 * @method name: list
	 * @return type: List<CarCategory>
	 *	@param size
	 *	@return
	 */
	public List<CarCategory> list(int size){
		StringBuilder sb = new StringBuilder("FROM CarCategory order by sort desc");
		Finder f = Finder.create(sb.toString());
		f.setMaxResults(size);
		
		return find(f);
	}
}